Verify Endpoint
Use this endpoint to verify specific details related to an identification document. Replace {id} in the URL with the actual identification ID you want to verify.
Endpoint
POST https://app.trustchex.com/api/v1/identifications/{id}/verify
Include your API key in the x-api-key header.
Request Body
{
"type": "DOCUMENT_NUMBER",
"value": "123456789"
}
Valid Types
CONTACT_EMAIL: Verify the contact email.CONTACT_PHONE: Verify the contact phone number.DOCUMENT_NUMBER: Verify the document number.DOCUMENT_TYPE: Verify the document type. Valid values:I: ID CardP: Passport
DOCUMENT_COUNTRY: Verify the document country. Use ISO 3166-1 alpha-3 codes (e.g.,TUR).
Example: JavaScript Fetch
fetch(`https://app.trustchex.com/api/v1/identifications/{id}/verify`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE',
},
body: JSON.stringify({
type: 'DOCUMENT_NUMBER',
value: '123456789'
})
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok ' + response.statusText);
}
return response.json();
})
.then(data => {
console.log('Verification Result:', data);
})
.catch(error => {
console.error('Fetch operation failed:', error);
});
Successful Response Example
{
"verified": true
}
Key Notes
- Handle the verification response appropriately in your application.
- A
trueresponse indicates the provided value matches the corresponding field in the identification document. - A
falseresponse indicates the verification failed.
Error Handling
Your application should handle the following errors:
403 Forbidden: API key is missing or invalid.404 Not Found: Identification or related resource not found.400 Bad Request: Invalid request body.500 Internal Server Error: An internal server error occurred. The response will include an error message.